<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('welcome');
});

Route::get('/demo',"DemoController@index");

//Route::get('/stu',"StuController@index");

Route::get('/test',"TestController@index");

/*Route::post('/hello', function () {
    return "Hello POST!";
});

Route::put('/hello', function () {
    return "Hello PUT!";
});

Route::delete('/hello', function () {
    return "Hello DELETE!";
});*/


Route::get('/test/{id?}', function ($id=null) {
    return"hello test".$id;
})->where("id","[0-9]+");


//ROUTEful控制器的路由配置
Route::resource('/stu',"StuController");




//数据分页
Route::get("/demo","StuController@index2");

//后台管理(采用路由配置)
Route::get('admin/login',"Admin\LoginController@index");
	Route::post('admin/login',"Admin\LoginController@doLogin");
Route::group(['prefix'=>'admin','middleware'=>'myauth'],function(){
	//后台会员登陆退出模块
	
	Route::get('login/logout',"Admin\LoginController@logout");

	//网站首页
	Route::get("index",function(){
		return view("admin.index");
	});
}
	);
 